import java.util.Stack;

public class Depozit implements Produs {
	Stack<String> sir_n=new Stack<String>();
	Stack<Integer> sir_cd=new Stack<Integer>();
	Stack<Integer> sir_p=new Stack<Integer>();
	Stack<Integer> sir_ct=new Stack<Integer>();

	public void adauga(String nume, int cod, int pret, int cant) {
		sir_n.add(nume);
		sir_cd.add(cod);
		sir_p.add(pret);
		sir_ct.add(cant);
	}

	public void sterge(String nume) {
		if(sir_n.contains(nume)){
			int index=sir_n.indexOf(nume);
			sir_n.removeElementAt(index);
			sir_cd.removeElementAt(index);
			sir_p.removeElementAt(index);
			sir_ct.removeElementAt(index);
			System.out.println("Produsul "+nume+" a fost sters !");
		}
		else{
			System.out.println("Produsul nu exista in depozit !");
		}
	}
	public String toString(){
		return "Nume \n"+sir_n.toString()+"\nCod \n"+sir_cd.toString()+"\nPret \n"+sir_p.toString()+"\nCantitate \n"+sir_ct.toString();
	}

}
